#ifndef COUNT_H
#define COUNT_H

#include <QWidget>
#include <QPointF>
#include <QVector>
#include <QRectF>
#include <QTimer>
#include <QTime>
#include <QDebug>
#include<QJsonDocument>
#include<QJsonObject>
#include<QJsonArray>

namespace Ui {
class Count;
}

class Count : public QWidget
{
    Q_OBJECT

public:
    explicit Count(QWidget *parent = nullptr);
    ~Count();
    void drawLineChart(/*QLabel *label,QVector<QPointF> points*/);
    QPointF mapPointToPlotArea(const QPointF &point, const QRectF &plotArea);
    void drawAxes(QPainter &painter,QRectF &plotArea);
signals:
    void openHistorySignal();
public slots:

    void dataUpSlots2(const QByteArray &msg);
    void updatedrawLineChart(QVector<QPointF> points);
    void updatetimeSlots();


private slots:
    void on_m_button_temp_clicked();

    void on_m_button_humi_clicked();

private:
    Ui::Count *ui;
    QVector<QPointF> m_points_temp;
    QVector<QPointF> m_points_humi;
    QTimer *timer;
    QTimer *timer1;
    int select;
    QStringList time;
    bool temp;
    bool humi;
    double m_lcd1;
    int m_lcd2;
//    QLabel* m_label;
};

#endif // COUNT_H
